/*******************************************************************************
* Copyright (c) 2010, 2018 西安秦晔信息科技有限公司
* Licensed under the Apache License, Version 2.0 (the "License");
*    you may not use this file except in compliance with the License.
*    You may obtain a copy of the License at
*
*       http://www.apache.org/licenses/LICENSE-2.0
*
*    Unless required by applicable law or agreed to in writing, software
*    distributed under the License is distributed on an "AS IS" BASIS,
*    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*    See the License for the specific language governing permissions and
*    limitations under the License.
*******************************************************************************/
package com.qinyeit.serviceapp.entity;

import com.qinyeit.serviceapp.entity.enums.State;
import lombok.Builder;
import lombok.experimental.Tolerate;

import javax.persistence.*;

/**
 * ClassName: DishesFeed <br/>
 * Function: 菜品加料 <br/>
 * date: 2018-11-23 13:42:18 <br/>
 *
 * @author liuwenjin
 * @version  1.0
 * @since JDK 1.8
 */
@Builder
@Entity
@Table(name="dishes_feeds")
public class DishesFeed extends MerchantGroupBaseEntity<Long> {

	private static final long serialVersionUID = 1L;

	// 菜品库 
    @Column(name="store_id")
	private Long storeId = null;

	// 名称 
    @Column(name="name", length = 300)
	private String name = null;

	// 价格 
    @Column(name="price",scale=2)
	private Double price = 0.0;


	// 状态
	@Column(name="state", length = 300)
	@Enumerated(EnumType.STRING)
	private State state = State.NORMAL;

	// 加料分类
	@ManyToOne
	@JoinColumn(name="type_id")
	private DishesFeedCategory type = null;

	//创建的时候生成 编辑的时候不变
	@Column(name="uuid", length = 300)
	private String uuid = "";

	//更新的时间戳 long
	@Column(name="update_timestamp")
	private Long updateTimestamp = null;



	@Tolerate
	public DishesFeed() {
		
	}
    @Tolerate
	public DishesFeed(Long id){
    	super.setId(id);
    }

	public DishesFeedCategory getType() {
		return type;
	}

	public void setType(DishesFeedCategory type) {
		this.type = type;
	}

	/**
	 * 获取菜品库
	 */
	public Long getStoreId() {
		return this.storeId;
	}

    /**
     * 设置菜品库
     */
	public DishesFeed setStoreId(Long storeId) {
		this.storeId = storeId;
		return this;
	}

	/**
	 * 获取名称
	 */
	public String getName() {
		return this.name;
	}

    /**
     * 设置名称
     */
	public DishesFeed setName(String name) {
		this.name = name;
		return this;
	}

	/**
	 * 获取价格
	 */
	public Double getPrice() {
		return this.price;
	}

    /**
     * 设置价格
     */
	public DishesFeed setPrice(Double price) {
		this.price = price;
		return this;
	}

	public State getState() {
		return state;
	}

	public void setState(State state) {
		this.state = state;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public Long getUpdateTimestamp() {
		return updateTimestamp;
	}

	public void setUpdateTimestamp(Long updateTimestamp) {
		this.updateTimestamp = updateTimestamp;
	}
}
